<!DOCTYPE html>
<!--
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
-->
<html>
<head>
	<title>Inline Editing by Code &mdash; CKEditor Sample</title>
	<meta charset="utf-8">
	<script src="../ckeditor.js"></script>
	<link href="sample.css" rel="stylesheet">
	<style>

		#editable
		{
			width: 45%;
			padding: 10px;
			float: left;
		}

	</style>
</head>
<body>
	<h1 class="samples">
		<a href="index.html">CKEditor Samples</a> &raquo; Inline Editing by Code
	</h1>
	<div class="description">
		<p>
			This sample shows how to create an inline editor instance of CKEditor. It is created
			with a JavaScript call using the following code:
		</p>
<pre class="samples">
// This property tells CKEditor to not activate every element with contenteditable=true element.
CKEDITOR.disableAutoInline = true;

var editor = CKEDITOR.inline( document.getElementById( 'editable' ) );
</pre>
		<p>
			Note that <code>editable</code> in the code above is the <code>id</code>
			attribute of the <code>&lt;div&gt;</code> element to be converted into an inline instance.
		</p>
	</div>
	<div id="editable" contenteditable="true">
		<h2>
			<img alt="" src="http://a.cksource.com/c/1/inc/img/demo-little-red.jpg" style="margin-left: 10px;
				margin-right: 10px; float: left; width: 120px; height: 168px;">Little Red
			Riding Hood
		</h2>
		<p>
			&quot;<b>Little Red Riding Hood</b>&quot; is a famous <a href="http://en.wikipedia.org/wiki/Fairy_tale"
				title="Fairy tale">fairy tale</a> about a young girl&#39;s encounter with a
			wolf. The story has been changed considerably in its history and subject to numerous
			modern adaptations and readings.
		</p>
		<table style="width: 200px; float: right;">
			<caption>
				<strong>International Names</strong>
			</caption>
			<tbody>
				<tr>
					<td>
						Chinese
					</td>
					<td>
						<i>小紅帽</i>
					</td>
				</tr>
				<tr>
					<td>
						Italian
					</td>
					<td>
						<i>Cappuccetto Rosso</i>
					</td>
				</tr>
				<tr>
					<td>
						Spanish
					</td>
					<td>
						<i>Caperucita Roja</i>
					</td>
				</tr>
			</tbody>
		</table>
		<p>
			The version most widely known today is based on the <a href="http://en.wikipedia.org/wiki/Brothers_Grimm"
				title="Brothers Grimm">Brothers Grimm</a> variant. It is about a girl called
			Little Red Riding Hood, after the red <a href="http://en.wikipedia.org/wiki/Hood_%28headgear%29"
				title="Hood (headgear)">hooded</a> <a href="http://en.wikipedia.org/wiki/Cape" title="Cape">
					cape</a> or <a href="http://en.wikipedia.org/wiki/Cloak" title="Cloak">cloak</a>
			she wears. The girl walks through the woods to deliver food to her sick grandmother.</p>
		<p>
			A wolf wants to eat the girl but is afraid to do so in public. He approaches the
			girl, and she na&iuml;vely tells him where she is going. He suggests the girl pick
			some flowers, which she does. In the meantime, he goes to the grandmother&#39;s
			house and gains entry by pretending to be the girl. He swallows the grandmother
			whole, and waits for the girl, disguised as the grandmother.</p>
		<p>
			When the girl arrives, she notices he looks very strange to be her grandma. In most
			retellings, this eventually culminates with Little Red Riding Hood saying, &quot;My,
			what big teeth you have!&quot;<br>
			To which the wolf replies, &quot;The better to eat you with,&quot; and swallows
			her whole, too.</p>
		<p>
			A <a href="http://en.wikipedia.org/wiki/Hunter" title="Hunter">hunter</a>, however,
			comes to the rescue and cuts the wolf open. Little Red Riding Hood and her grandmother
			emerge unharmed. They fill the wolf&#39;s body with heavy stones, which drown him
			when he falls into a well. Other versions of the story have had the grandmother
			shut in the closet instead of eaten, and some have Little Red Riding Hood saved
			by the hunter as the wolf advances on her rather than after she is eaten.</p>
		<p>
			The tale makes the clearest contrast between the safe world of the village and the
			dangers of the <a href="http://en.wikipedia.org/wiki/Enchanted_forest" title="Enchanted forest">
				forest</a>, conventional antitheses that are essentially medieval, though no
			written versions are as old as that.</p>
	</div>
	<script>

		// We need to turn off the automatic editor creation first.
		CKEDITOR.disableAutoInline = true;

		var editor = CKEDITOR.inline( 'editable' );

	</script>
	<div id="footer">
		<hr>
		<p contenteditable="true">
			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
				http://ckeditor.com</a>
		</p>
		<p id="copy">
			Copyright &copy; 2003-2012, <a class="samples" href="http://cksource.com/">CKSource</a>
			- Frederico Knabben. All rights reserved.
		</p>
	</div>
</body>
</html>
